package edu.zut.bailan.topicmenu.service.impl;

import edu.zut.bailan.base.service.impl.GenericManagerImpl;
import edu.zut.bailan.topicmenu.dao.TopicMenuDao;
import edu.zut.bailan.topicmenu.domain.TopicMenu;
import edu.zut.bailan.topicmenu.service.TopicMenuManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import java.util.ArrayList;
import java.util.List;

@Service
@Transactional
public class TopicMenuManagerImpl extends GenericManagerImpl<TopicMenu, Long>
        implements TopicMenuManager {

    TopicMenuDao menuDao;

    @Autowired
    public void setMenuDao(TopicMenuDao menuDao) {
        this.menuDao = menuDao;
        this.dao = this.menuDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 100; i++) {
            TopicMenu m = new TopicMenu();
            m.setName("menu_"+i);
            m.setCode("menu_code_"+i);
            m.setEntityName("edu.zut.edu.fortune");
            list.add(m);
        }
        return list;
    }
}